<html>
<head><meta charset="utf-8"><title>flamegraph · t-compiler/wg-self-profile · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/index.html">t-compiler/wg-self-profile</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html">flamegraph</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="179917443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/179917443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#179917443">(Nov 05 2019 at 10:10)</a>:</h4>
<p>have implemented the use of inferno for the <a href="https://github.com/rust-lang/measureme/issues/42" target="_blank" title="https://github.com/rust-lang/measureme/issues/42">https://github.com/rust-lang/measureme/issues/42</a> but now it feels strange to call the tool stack_collapse when it generates the flamegraph svg file directly. shall I change the name to flamegraph in the same PR?</p>



<a name="179920409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/179920409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#179920409">(Nov 05 2019 at 10:52)</a>:</h4>
<p>That sounds fine to me!</p>



<a name="179945449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/179945449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#179945449">(Nov 05 2019 at 15:56)</a>:</h4>
<p>before I spend to much time on this. have been looking in to the "missing data in flamegraph" <a href="https://github.com/rust-lang/rust/issues/65788" target="_blank" title="https://github.com/rust-lang/rust/issues/65788">https://github.com/rust-lang/rust/issues/65788</a> and have made a test that I thinks is correct but do not pass <a href="https://github.com/rust-lang/measureme/compare/master...andjo403:collapse_threads" target="_blank" title="https://github.com/rust-lang/measureme/compare/master...andjo403:collapse_threads">https://github.com/rust-lang/measureme/compare/master...andjo403:collapse_threads</a> can someone check if I'm thinking correct that it shall pass</p>



<a name="179946053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/179946053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#179946053">(Nov 05 2019 at 16:01)</a>:</h4>
<p>moved some of the events from the old test to a new thread and as I think that the order between threads is not guaranteed I change the order for two events</p>



<a name="179946315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/179946315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#179946315">(Nov 05 2019 at 16:04)</a>:</h4>
<p>I think that looks correct to me</p>



<a name="180030198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180030198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180030198">(Nov 06 2019 at 13:13)</a>:</h4>
<p>I'm trying to update <code>collapse_stacks</code> for <a href="https://github.com/rust-lang/measureme/pull/76" target="_blank" title="https://github.com/rust-lang/measureme/pull/76">https://github.com/rust-lang/measureme/pull/76</a> but I don't quite understand what the output file is supposed to look like.</p>



<a name="180030208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180030208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180030208">(Nov 06 2019 at 13:13)</a>:</h4>
<p>is there documentation for it somewhere?</p>



<a name="180031852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180031852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180031852">(Nov 06 2019 at 13:31)</a>:</h4>
<p>there is some description on <a href="https://github.com/brendangregg/FlameGraph#2-fold-stacks" target="_blank" title="https://github.com/brendangregg/FlameGraph#2-fold-stacks">https://github.com/brendangregg/FlameGraph#2-fold-stacks</a> <br>
but it is a semicolon separated string of the stack followed by an number that represent how many times that stack is present with  some sample interval in the log resulting in that if there is multiple threads the number of stacks is larger then the wall time divided by the sample interval</p>



<a name="180032003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180032003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180032003">(Nov 06 2019 at 13:32)</a>:</h4>
<p>also each stack + count is one line in the file</p>



<a name="180037143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180037143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180037143">(Nov 06 2019 at 14:29)</a>:</h4>
<p>ok, that sounds simple enough. thanks, <span class="user-mention" data-user-id="125799">@Andreas Jonson</span> !</p>



<a name="180039197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180039197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180039197">(Nov 06 2019 at 14:50)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span>  have added some more description in the stack collapse tests see <a href="https://github.com/rust-lang/measureme/pull/78" target="_blank" title="https://github.com/rust-lang/measureme/pull/78">https://github.com/rust-lang/measureme/pull/78</a></p>



<a name="180051926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180051926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180051926">(Nov 06 2019 at 16:48)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span>  think that the algorithm in perform_analysis in summerize can be reused for the stack_collaps, use the self time together with the stack to get a total time per stack and then at the end divide the time with the interval to get the count instead of time.</p>



<a name="180112219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180112219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180112219">(Nov 07 2019 at 08:36)</a>:</h4>
<p>I wonder if there is a problem with using a sampling interval of 1ns. Then <code>time == count</code>.</p>



<a name="180211471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211471">(Nov 08 2019 at 08:39)</a>:</h4>
<p><span class="user-mention" data-user-id="125799">@andjo403</span> I looked at the implementation of the algorithm you are proposing and I think it's very smart!</p>



<a name="180211481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211481">(Nov 08 2019 at 08:39)</a>:</h4>
<p>It is actually simpler than my implementation</p>



<a name="180211489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211489">(Nov 08 2019 at 08:39)</a>:</h4>
<p>I'm wondering though: is there any benefit in the scaling step?</p>



<a name="180211549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211549">(Nov 08 2019 at 08:40)</a>:</h4>
<p>it will only cost accuracy and won't produce the same results as sampling anyway</p>



<a name="180211568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211568">(Nov 08 2019 at 08:41)</a>:</h4>
<p>I do not know of any use case for the interval so think that it can be removed</p>



<a name="180211625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211625">(Nov 08 2019 at 08:42)</a>:</h4>
<p>it might be somehow related to flamegraphs also supporting sampling profilers</p>



<a name="180211641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211641">(Nov 08 2019 at 08:42)</a>:</h4>
<p>but I don't think that really applies with our kind of data</p>



<a name="180211656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211656">(Nov 08 2019 at 08:43)</a>:</h4>
<p>I added the scaling to match the old implementation</p>



<a name="180211668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211668">(Nov 08 2019 at 08:43)</a>:</h4>
<p>I agree with you that it do not apply as we have exact data</p>



<a name="180211670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211670">(Nov 08 2019 at 08:43)</a>:</h4>
<p>let's try without the scaling and we'll see if we run into problems</p>



<a name="180211717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211717">(Nov 08 2019 at 08:44)</a>:</h4>
<p>I could imagine that there is some upper limit for the counters</p>



<a name="180211720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211720">(Nov 08 2019 at 08:44)</a>:</h4>
<p>or that we get to many samples</p>



<a name="180211738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211738">(Nov 08 2019 at 08:44)</a>:</h4>
<p>but we can add some kind of scaling/filtering back in if needed</p>



<a name="180211763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211763">(Nov 08 2019 at 08:45)</a>:</h4>
<p>Thanks for providing the alternative implementation!</p>



<a name="180211775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180211775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180211775">(Nov 08 2019 at 08:45)</a>:</h4>
<p>No problem</p>



<a name="180212943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180212943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180212943">(Nov 08 2019 at 09:06)</a>:</h4>
<p><span class="user-mention" data-user-id="125799">@andjo403</span> I've removed the WIP commit from my branch. Do you want to update your PR? Then the commit has your name on it.</p>



<a name="180213372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180213372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> andjo403 <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180213372">(Nov 08 2019 at 09:14)</a>:</h4>
<p>For me it do not matter if my name is there or not kan not do any updates until after work so you can take and change as you like</p>



<a name="180213530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/flamegraph/near/180213530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/flamegraph.html#180213530">(Nov 08 2019 at 09:17)</a>:</h4>
<p>OK, then I'll just copy and paste your code and mention your contribution in the commit message</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>